/**
 * Created by luobo on 16/07/2017.
 */
function $(selector) {
    var prefix = selector.substring(0,1);
    var suffix = selector.substring(1);
    if(prefix == '#'){
        return document.getElementById(suffix);
    }else if(prefix == '|'){
        return document.getElementsByName(suffix);
    }else if(prefix == '.'){
        return document.getElementsByClassName(suffix);
    }else {
        return document.getElementsByTagName(suffix);
    }
}